package com.me.mygdxgame;

import GameStates.MainMenu;
import GameStates.StateManager;

import com.badlogic.gdx.Game;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.FPSLogger;
import com.me.mygdxgame.renderer.AssetsManager;

public class RacingGame extends Game
{
	private FPSLogger fps;
	private float progress;
	

	@Override
	public void create()
	{
		StateManager.getInstance().setGame(this);
		StateManager.getInstance().changeState(new MainMenu());
		fps = new FPSLogger();
	}

	@Override
	public void render()
	{
		if (AssetsManager.getInstance().update())
		{
			StateManager.getInstance().update(Gdx.graphics.getDeltaTime());
		}
		else
		{
			progress = AssetsManager.getInstance().getProgress();
			Gdx.app.log("Loading...", Float.toString(progress));
			
			
		}

		fps.log();
	}

}
